package com.example.aopdemo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-01-26
 * Time: 18:54
 */
@Slf4j
@Aspect
//@Component
@Order(5)
public class AspectDemo3 {
    @Pointcut("execution(* com.example.aopdemo.controller.*.*(..))")
    public void pt(){};

    @Before("pt()")
    public void doBefore() {
        log.info("AspectDemo3执行doBefore....");
    }


    @After("pt()")
    public void doAfter() {
        log.info("AspectDemo3执行doAfter....");
    }
}
